/*
** hook.c for  in /home/guicqu_g//rush/epikong/etape_1
** 
** Made by gallien guicquero
** Login   <guicqu_g@epitech.net>
** 
** Started on  Sat Mar 26 12:54:34 2011 gallien guicquero
** Last update Sat Mar 26 12:59:52 2011 gallien guicquero
*/

#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include "mlx.h"
#include "window.h"

int	key_hook(int key, t_p *p)
{
  if (key == KEY_ESCAPE)
    exit(0);
  printf("Key: %d %x\n", key, key);
  p = p;
  return (key);
}

int	expose_hook(t_p *p)
{
  mlx_put_image_to_window(p->mlx, p->w.win, p->i.img, 0, 0);
  return (0);
}

int	mouse_hook(int button, int x, int y, t_p *p)
{
  printf("Button:%d X:%d Y:%d\n", button, x, y);
  p = p;
  return (0);
}

int	loop_hook(t_p *p)
{
  p = p;
  usleep(42);
  return (0);
}
